"""tianqi URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, patterns
from django.conf import settings

import xadmin
import apps.views as views

urlpatterns = [
    url(r'^$', 'apps.views.Index', name='index'),
    url(r'^food/(?P<classid>\d+)/(?P<id>\d+)/index.html$', 'apps.views.Food', name='food'),
    url(r'^daily/$', 'apps.views.Daily', name='Daily'),
    url(r'^snacks/$', 'apps.views.Snacks', name='Snacks'),
    url(r'^health/$', 'apps.views.Healths', name='Healths'),
    url(r'^health/(?P<id>\d+)/index.html$', 'apps.views.Healths_id', name='Healths_id'),
    url(r'^class/(?P<classid>\d+)/index.html$', 'apps.views.Classification', name='classification'),
    url(r'^search$', 'apps.views.Search', name='search'),
    url(r'^contant/link.html$', 'apps.views.Links', name='Link'),
    url(r'^carey/index.html$', 'apps.views.Clear_Cache', name='clear_cache'),
    url(r'^xadmin/', xadmin.site.urls),
]

if settings.DEBUG is False:
    urlpatterns += patterns('',
        url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.STATIC_ROOT,
        }),
   )

handler403 = views.permission_denied
handler404 = views.page_not_found
handler500 = views.page_error
